FROM docker.1ms.run/library/node:18.16.0 as build-stage

# 将所有文件复制到工作目录
WORKDIR /app
COPY . .

# 安装依赖并构建Vue项目


RUN npm install --legacy-peer-deps
RUN npm run build:dev

# 在Nginx基础镜像上运行Vue项目
FROM docker.1ms.run/library/nginx:latest
COPY --from=build-stage /app/dist /usr/share/nginx/html/

EXPOSE 80

# 启动 Nginx
CMD ["nginx", "-g", "daemon off;"]